# R script for figures in "Human Rights versus National Interests: Shifting US Public Attitudes on the International Criminal Court"
# Author: Kelebogile Zvobgo

# ORIGINAL CODE FROM:
# Chaudoin, Stephen, 2013, "Replication data for: Promises or Policies? 
# An Experimental Analysis of International Agreements and Audience Reactions", 
# https://hdl.handle.net/1902.1/21980, Harvard Dataverse, V2, UNF:5:0/Z3wzEVAt4tzNUW3vdp0w==; 
# replication_2013_07_29.R [fileName]



setwd("/Users/kelebogilezvobgo/Desktop/Research/1_ICC-Public-Opinion/ISQ_FINAL/Data")

library(foreign)
library(MASS)
library(gplots)
library(ggplot2)
library(Hmisc)
library(sciplot)
library(RItools)

rm(list=ls())

qtdata <- read.dta("HR-versus-NI_ISQ-Replication_Data.dta")


xBalance(hr_only~ race_1 + gender + party_2 + college + under_40, data=qtdata,
         report="all")
xBalance(ni_only~ race_1 + gender + party_2 + college + under_40, data=qtdata,
         report="all")
xBalance(competitive~ race_1 + gender + party_2 + college + under_40, data=qtdata,
         report="all")
xBalance(control~ race_1 + gender + party_2 + college + under_40, data=qtdata,
         report="all")